From 0675fce5067b77ecc4d9ad6e311d8f64700754e7 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Timm=20B=C3=A4der?= Date: Fri, 17 Feb 2017 18:20:12 +0100 Subject: [PATCH] flowboxchild: Use gtk_widget_measure to measure widget sizes GtkFlowBoxChild is a simple GtkBin, so measure the child widget size in a simple way. --- gtk/gtkflowbox.c | 48 ++---------------------------------------------- 1 file changed, 2 insertions(+), 46 deletions(-) diff --git a/gtk/gtkflowbox.c b/gtk/gtkflowbox.c index 9c496e8ef0..bd73e43d29 100644 --- a/gtk/gtkflowbox.c +++ b/gtk/gtkflowbox.c @@ -458,52 +458,8 @@ gtk_flow_box_child_measure (GtkCssGadget *gadget, return; } - if (orientation == GTK_ORIENTATION_HORIZONTAL) - { - if (for_size < 0) - { - if (gtk_flow_box_child_get_request_mode (widget) == GTK_SIZE_REQUEST_HEIGHT_FOR_WIDTH) - { - gtk_widget_get_preferred_width (child, minimum, natural); - } - else - { - gint height; - gtk_widget_get_preferred_height (child, NULL, &height); - gtk_widget_get_preferred_width_for_height (child, height, minimum, natural); - } - } - else - { - if (gtk_flow_box_child_get_request_mode (widget) == GTK_SIZE_REQUEST_HEIGHT_FOR_WIDTH) - gtk_widget_get_preferred_width (child, minimum, natural); - else - gtk_widget_get_preferred_width_for_height (child, for_size, minimum, natural); - } - } - else - { - if (for_size < 0) - { - if (gtk_flow_box_child_get_request_mode (widget) == GTK_SIZE_REQUEST_HEIGHT_FOR_WIDTH) - { - gint width; - gtk_widget_get_preferred_width (child, NULL, &width); - gtk_widget_get_preferred_height_for_width (child, width, minimum, natural); - } - else - { - gtk_widget_get_preferred_height (child, minimum, natural); - } - } - else - { - if (gtk_flow_box_child_get_request_mode (widget) == GTK_SIZE_REQUEST_HEIGHT_FOR_WIDTH) - gtk_widget_get_preferred_height_for_width (child, for_size, minimum, natural); - else - gtk_widget_get_preferred_height (child, minimum, natural); - } - } + gtk_widget_measure (child, orientation, for_size, + minimum, natural, minimum_baseline, natural_baseline); } static void -- 2.30.2